home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / channel.h < prev    next >
C/C++ Source or Header  |  1995-05-11  |  4KB  |  153 lines

  1. /* channel.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* $Id: channel.h,v 4.15 1995/05/11 12:30:33 espie Exp espie $
  6.  * $Log: channel.h,v $
  7.  * Revision 4.15  1995/05/11  12:30:33  espie
  8.  * *** empty log message ***
  9.  *
  10.  * Revision 4.14  1995/03/11  21:40:13  espie
  11.  * Added better jump pattern, invert_loop.
  12.  *
  13.  * Revision 4.13  1995/03/04  00:15:28  espie
  14.  * Implemented vibrato control.
  15.  *
  16.  * Revision 4.12  1995/03/01  15:24:51  espie
  17.  * Added start_offset.
  18.  *
  19.  * Revision 4.11  1995/02/21  17:54:32  espie
  20.  * Internal problem: buggy RCS. Fixed logs.
  21.  *
  22.  * Revision 4.9  1995/02/20  22:28:50  espie
  23.  * Tremolo
  24.  *
  25.  * Revision 4.8  1995/02/20  16:49:58  espie
  26.  * Added funk_glissando for command 3.
  27.  *
  28.  * Revision 4.5  1995/02/01  16:39:04  espie
  29.  * Includes moved to defs.h
  30.  *
  31.  * Revision 3.9  1993/11/17  15:31:16  espie
  32.  * audio_channel private.
  33.  * Amiga support.
  34.  * Added finetune.
  35.  *
  36.  * Revision 2.7  1992/11/13  13:24:24  espie
  37.  * Added parameters for extended Retriger command.
  38.  * Added transpose feature.
  39.  * Structured part of the code, especially replay ``automaton''
  40.  * and setting up of effects.
  41.  *
  42.  * Revision 1.5  1991/11/16  16:54:19  espie
  43.  * Bug correction: when doing arpeggio, there might not
  44.  * be a new note, so we have to save the old note value
  45.  * and do the arppeggio on that note.
  46.  * Added fields for arpeggio.
  47.  */
  48.  
  49.      
  50. #ifndef NUMBER_PATTERNS
  51. #define NUMBER_PATTERNS 128
  52. #endif
  53.  
  54. #define MAX_ARP 3
  55.      
  56. /* there is no note in each channel initially.
  57.  * This is defensive programming, because some
  58.  * commands rely on the previous note. Checking
  59.  * that there was no previous note is a way to
  60.  * detect faulty modules.
  61.  */
  62. #define NO_NOTE 255
  63.  
  64. struct channel
  65.    {
  66.    struct sample_info *samp;
  67.    struct audio_channel *audio;
  68.    int finetune;
  69.    int volume;             /* current volume of the sample (0-64) */
  70.    int pitch;              /* current pitch of the sample */
  71.    int note;               /* we have to save the note cause */
  72.                            /* we can do an arpeggio without a new note */
  73.     
  74.    int arp[MAX_ARP];       /* the three pitch values for an arpeggio */
  75.    int arpindex;           /* an index to know which note the arpeggio is doing */
  76.  
  77.    int viboffset;          /* current offset for vibrato (if any) */
  78.    int vibdepth;           /* depth of vibrato (if any) */
  79.    int vibrate;            /* step rate for vibrato */
  80.     int *vibtable;
  81.     int resetvib;
  82.  
  83.    int slide;              /* step size of pitch slide */
  84.  
  85.    int pitchgoal;          /* pitch to slide to */
  86.    int pitchrate;          /* step rate for portamento */
  87.  
  88.    int volumerate;         /* step rate for volume slide */
  89.  
  90.  
  91.     int tremoffset;
  92.     int tremdepth;
  93.     int tremrate;
  94.     int *tremtable;
  95.     int resettrem;
  96.  
  97.     int start_offset;
  98.  
  99.    int retrig;             /* delay for extended retrig command */
  100.    int current;
  101.  
  102.     int funk_glissando;    
  103.                            /* current command to adjust parameters */
  104.    void (*adjust) P((struct channel *ch));
  105.     int loop_counter;
  106.     int loop_note_num;
  107.  
  108.     int invert_speed;
  109.     int invert_offset;
  110.     int invert_position;
  111.    void (*special) P((struct channel *ch));
  112.    };
  113.  
  114. #define DO_NOTHING 0 
  115. #define SET_SPEED 1
  116. #define SET_SKIP 2
  117. #define SET_FASTSKIP 4
  118. #define SET_FINESPEED 32
  119.  
  120. #define JUMP_PATTERN 8
  121. #define DELAY_PATTERN 16
  122.  
  123. #define NORMAL_SPEED 6
  124. #define NORMAL_FINESPEED 125
  125.  
  126. struct automaton
  127.    {
  128.    int pattern_num;           /* the pattern in the song */
  129.    int note_num;              /* the note in the pattern */
  130.    struct block *pattern;     /* the physical pattern */
  131.    struct song_info *info;    /* we need the song_info */
  132.  
  133.    char gonethrough[NUMBER_PATTERNS + 1];  /* to check for repeats */
  134.  
  135.    int counter;               /* the fine position inside the effect */
  136.    int speed;                 /* the `speed', number of effect repeats */
  137.    int finespeed;             /* the finespeed, base is 100 */
  138.  
  139.    int do_stuff;              /* keeping some stuff to do */
  140.                               /* ... and parameters for it: */
  141.    int new_speed, new_note, new_pattern, new_finespeed;
  142.  
  143.    int pitch, note, para;     /* some extra parameters effects need */
  144.  
  145.    int loop_note_num, loop_counter;
  146.                               /* for command E6 */
  147.  
  148.    int delay_counter;
  149.                               /* for command EE */
  150.                                         /* =0 -> no delay, next pattern immediately
  151.                                          * >0 -> count down */
  152.    };
  153.